<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-1.12.4.min.js"></script>
    <script src="./template-native.js"></script>
    <script type="text/html" id="tem">
        <% for (var i = 0;i < 5;i++) { %>
            <div>这是一个模板中的div1</div>
            <div>这是一个模板中的div1</div>
        <% } %>
    </script>
</head>
<body>
    <div class="box"></div>
    <script>
        $('.box').html( template("tem"));
    </script>
</body>
</html>